home *** CD-ROM | disk | FTP | other *** search
- (*
- ** SYSID.PAS
- **
- ** Version 4.7
- **
- ** Usage: [d:][path]SYSID
- **
- ** A system description for DOS-based PC/XT/AT- and PS/2-class machines.
- ** SYSID generates 16 screens of information about the host system and runs
- ** under DOS versions 3.0 and later.
- **
- ** My primary sources of ideas in SYSID were Ray Duncan's "Advanced MS-DOS
- ** Programming," Terry Dettman's "DOS Programmer's Reference," and the
- ** "ms.dos/secrets" conference on BIX. Bob Smith's article "Chips in
- ** Transition", PC Tech Journal 4 : 4, p. 56, and Prakash Chandra's article
- ** "?", Byte 13 : ? p. ? were valuable references. The ideas of Terje
- ** Mathisen, Barry Nance, and others also appear in various places. Mike
- ** Sargent and Redmond Simonsen contributed valuable feedback during the
- ** development of SYSID.
- **
- ** Some of the techniques SYSID uses are not documented or officially
- ** supported by either IBM or Microsoft. Where possible I have followed the
- ** undocumented routine with a comment describing my source for the
- ** technique. If such a technique is not commented, the source was most
- ** likely the Dettman book.
- **
- ** SYSID was developed on an IBM PC with Turbo Pascal 5.0, Turbo Assembler
- ** 1.0, and DOS 3.30. The source code has been split into three files:
- **
- ** SYSID.PAS - this file
- ** SYSID.INC - Pascal functions and procedures
- ** SYSID.ASM - assembly language functions and procedures
- **
- ** Known bugs:
- ** 1) Page 2: The CPU test for interrupts of multi-prefix string
- ** instructions is reliable only on machines whose clock speeds are
- ** less than about 15 MHz. The 8086 and 8088 are the only CPU's that
- ** don't handle such interrupts correctly, however, and they aren't
- ** (to my knowledge) ever run at anything like 15 MHz. (This 15 MHz
- ** limit assumes that the timer tick interrupt occurs at the standard
- ** rate of 18.2 Hz. SYSID could check that, too, I suppose.)
- ** 2) Page 5: The description of foreground color will not mention the
- ** blinking attribute, even if it was enabled before you invoked
- ** SYSID.
- ** 3) Page 10: SYSID used to report incorrectly the statuses of some of
- ** the executable files which use the "multiplex interrupt" (INT
- ** 2FH). I have commented these status checks out of the source
- ** code, determined to do battle with them another day. Can anyone
- ** supply the correct INT 2FH functions for these files? Or are some
- ** of them red herrings that simply check INT 2FH to see if *other*
- ** files have been loaded (e.g. APPEND/ASSIGN)?
- ** 4) The error beep sometimes fails to sound when you press the first
- ** erroneous key (e.g. PgDn while on the last page. It appears to
- ** work correctly for the second and subsequent erroneous keys. I
- ** have no idea why.
- ** 5) Not all BIOSes and OEM versions of DOS operate precisely the same
- ** way their IBM counterparts do. If not everything in your system
- ** is true-Blue, SYSID's report may not be exactly what you expect.
- **
- ** SYSID is copyright 1989 by Steve Grant. All rights reserved. Neither the
- ** source code nor the object code of SYSID carries any warranty, either
- ** express or implied, of merchantability or of fitness for a particular
- ** purpose. Comments, suggestions, and questions may be addressed to:
- ** BIXMail: sjgrant
- ** CompuServe: 71101,706
- **
- ** Steve Grant
- ** Long Beach, CA
- ** July 31, 1989
- *)
-
- (*$A-*)
- (*$B-*)
- (*$D+*)
- (*$F-*)
- (*$I-*)
- (*$M 16384, 0, 655360*)
- (*$N-*)
- (*$O-*)
- (*$R-*)
- (*$S-*)
- (*$V-*)
-
- program SYSID;
-
- uses
- crt,
- dos,
- graph;
-
- const
- notice = 'Copyright 1989 by Steve Grant';
-
- const
- BIOSdseg = $0040;
- pgmax = 16;
- pchar = [' '..'~'];
- secsiz = 512;
- tick1 = 1193180;
-
- type
- cpu_info_t = record
- cpu_type : byte;
- MSW : word;
- GDT : array[1..6] of byte;
- IDT : array[1..6] of byte;
- opsize : boolean;
- chkint : boolean;
- mult : boolean;
- ndp_type : byte;
- ndp_cw : word
- end;
-
- var
- attrsave : byte;
- ccode : word;
- country : array[0..33] of byte;
- currdrv : byte;
- devofs : word;
- devseg : word;
- dirsep : set of char;
- DOScofs : word;
- DOScseg : word;
- DOSmem : longint;
- equip : word;
- graphdriver : integer;
- i : word;
- intvec : array[$00..$FF] of pointer;
- osmajor : byte;
- osminor : byte;
- pg : 1..pgmax;
- regs : registers;
- switchar : char;
- tlength : byte;
- twidth : byte;
- vidpg : byte;
- x1 : byte;
- x2 : byte;
- xbool1 : boolean;
- xbool2 : boolean;
- xchar1 : char;
- xchar2 : char;
- xword : word;
-
- (*$L SYSID *)
-
- (*$I SYSID.INC *)
-
- begin
- xword := dosversion;
- osmajor := lo(xword);
- osminor := hi(xword);
- if osmajor = 3 then begin
- init;
- xbool1 := false;
- repeat
- gotoxy(x1, tlength);
- textcolor(lightgray);
- write(pg : 2);
- window(1, 3, twidth, tlength - 2);
- clrscr;
- case pg of
- 1 : page_01;
- 2 : page_02;
- 3 : page_03;
- 4 : page_04;
- 5 : page_05;
- 6 : page_06;
- 7 : page_07;
- 8 : page_08;
- 9 : page_09;
- 10 : page_10;
- 11 : page_11;
- 12 : page_12;
- 13 : page_13;
- 14 : page_14;
- 15 : page_15;
- 16 : page_16
- end;
- window(1, 1, twidth, tlength);
- gotoxy(x2, tlength);
- xbool2 := false;
- repeat
- repeat
- until keypressed;
- xchar1 := readkey;
- if keypressed then
- xchar2 := readkey
- else
- xchar2 := #0;
- if (xchar1 = #27) and (xchar2 = #0) then begin
- xbool2 := true;
- xbool1 := true
- end else if (xchar1 = #0) and (xchar2 = #71) and (pg > 1) then
- begin
- xbool2 := true;
- pg := 1
- end else if (xchar1 = #0) and (xchar2 = #73) and (pg > 1) then
- begin
- xbool2 := true;
- dec(pg)
- end else if (xchar1 = #0) and (xchar2 = #79) and (pg < pgmax)
- then begin
- xbool2 := true;
- pg := pgmax
- end else if (xchar1 = #0) and (xchar2 = #81) and (pg < pgmax)
- then begin
- xbool2 := true;
- inc(pg)
- end else begin
- sound(220);
- delay(100);
- nosound
- end
- until xbool2
- until xbool1;
- textattr := attrsave;
- clrscr
- end else begin
- writeln;
- writeln('SYSID requires DOS version 3.x');
- write('Your DOS version is ');
- if osmajor > 0 then begin
- write(osmajor, '.');
- zeropad(osminor);
- writeln
- end else
- writeln('1.x')
- end
- end.